package cn.edu.ujn.finalwork.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.finalwork.dao.Customer;
import cn.edu.ujn.finalwork.dao.CustomerMapper;

@Service
public class CustomerServiceImpl implements ICustomerService {

	@Autowired
	CustomerMapper customermapper;
	
	@Override
	public int insertSelective(Customer customer) {
		int insertSelective=customermapper.insertSelective(customer);
		return insertSelective;
	}

	@Override
	public Customer selectByPrimaryKey(int id) {
		Customer selectByPrimaryKey=customermapper.selectByPrimaryKey(id);
		return selectByPrimaryKey;
	}

	@Override
	public List<Customer> selectAll() {
	List<Customer> customers = customermapper.selectAll();
		return customers;
	}



	@Override
	public int updateByPrimaryKeySelective(Customer customer) {
		int updateByPrimaryKeySelective = customermapper.updateByPrimaryKeySelective(customer);
		return updateByPrimaryKeySelective;
	}

	@Override
	public List<Customer> selective(Customer customer) {
		List<Customer> selectByIdAndName = customermapper.selective(customer);
		return selectByIdAndName;
	}

    @Override
    public int delectByPrimaryKey(int c) {
        int deleteByPrimaryKey = customermapper.deleteByPrimaryKey(c);
        return deleteByPrimaryKey;
    }


}
